<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>禁止页面刷新</title>
</head>

<body>
  页面跳动了吧
  <img src="http://www.ruanyifeng.com/blogimg/asset/2015/bg2015071016.png">
</body>
<script>
  "use strict";
  document.addEventListener("keydown", (e) => {
    if (e.code == "F5") {
      e.returnValue = false;
      e.cancelBubble = true;
      return false;
    };
  });
</script>

</html>